import { ref } from 'vue'

export function wechat(params) {
    // 小程序登录码
    function getWechatLoginCode() {
        return new Promise((resolve, reject) => {
            uni.login({
                provider: 'weixin',
                success: (res) => {
                    code.value = res.code
                    resolve(res.code)
                },
                fail: (err) => {
                    reject(err)
                },
            })
        })
    }

    return {
        getWechatLoginCode,
    }
}
